var o = require("../../../@babel/runtime/helpers/typeof"), a = getApp();

Page({
    data: {
        language: "",
        username1: "微店名称",
        level1: "级别",
        share1: "0",
        share2: "0",
        totalTicket: 0,
        totalShareMoney: 0,
        userImg: "",
        orderData: "",
        shareData: "",
        shop_id: "",
        shoplang: "",
        ban_open: !1
    },
    onLoad: function(o) {
        o.shop_id && this.setData({
            shop_id: o.shop_id
        }), this.checkrouter(), this.getJson();
    },
    checkrouter: function() {
        try {
            var a = function() {
                for (var o = wx.getStorageSync("yz_basic_info"), a = o.popularize_page.mini.vue_route, t = 0; t < a.length; t++) if ("microShop_ShopKeeperCenter" == a[t]) return console.log(o.popularize_page.mini.mini_url + "跳转的路径"), 
                wx.showToast({
                    title: "未开启推广权限",
                    duration: 1e3,
                    icon: "none",
                    success: function() {
                        setTimeout(function() {
                            wx.redirectTo({
                                url: o.popularize_page.mini.mini_url
                            });
                        }, 1e3);
                    }
                }), {
                    v: void 0
                };
            }();
            if ("object" === o(a)) return a.v;
        } catch (o) {
            console.log(o);
        }
    },
    onReady: function() {
        var o = wx.getStorageSync("langIndex");
        this.setData({
            language: o.en
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    onconfirm: function(o) {
        this.setData({
            ban_open: !1
        });
    },
    gomicroShopOrderDetail: function() {},
    getJson: function() {
        var o = this, t = a.getNetAddresss("plugin.micro.frontend.controllers.MicroShop.index");
        a._getNetWork({
            url: t,
            success: function(a) {
                var t = a.data;
                1 == t.result && (o.setData({
                    userImg: t.data.micro_shop_data.shop_avatar,
                    username1: t.data.micro_shop_data.shop_name,
                    level1: t.data.micro_shop_data.level_name,
                    share1: t.data.micro_shop_data.bonus_ratio,
                    share2: t.data.micro_shop_data.agent_bonus_ratio,
                    totalTicket: t.data.order_data.order_total,
                    totalShareMoney: t.data.bonus_log_data.bonus_total,
                    shareData: t.data.bonus_log_data,
                    orderData: t.data.order_data
                }), 1 == t.data.is_ban && o.setData({
                    ban_open: !0
                }), t.data.lang && o.setData({
                    shoplang: t.data.lang
                }));
            },
            fail: function(o) {
                console.log(o);
            }
        });
    },
    gomicroShopbaseinfo: function() {
        wx.navigateTo({
            url: "/packageC/microshop/microShop_baseinfo/microShop_baseinfo?shop_id=" + this.data.shop_id
        });
    },
    gomicroShop_home: function() {
        wx.reLaunch({
            url: "/packageC/microshop/microShop_home/microShop_home?shop_id=" + this.data.shop_id
        });
    },
    gomicroShop_apply: function() {
        wx.navigateTo({
            url: "/packageC/microshop/microShop_apply/microShop_apply"
        });
    },
    gomicroShopShareList: function(o) {
        var a = o.currentTarget.dataset.date;
        wx.navigateTo({
            url: "/packageC/microshop/microShop_shareList/microShop_shareList?date=" + a
        });
    },
    microShopAddCategory: function() {
        wx.navigateTo({
            url: "/packageC/microshop/micro_shop_add_category/micro_shop_add_category?shop_id=" + this.data.shop_id
        });
    }
});